<%-- 
    Document   : edit
    Created on : Apr 19, 2010, 2:05:48 AM
    Author     : Пользователь
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<f:view locale="#{locale.locale}">
    <f:loadBundle basename="ru.ssau.berlin.jsf.i18n.Messages" var="bundle"/>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title><h:outputText value="#{bundle.ssau_manage_system} :: #{bundle.group_attribute}"/></title>
        </head>
        <body>
            <small>
                <h:form>
                    <h:commandLink action="#{locale.setLocale}" value="en">
                        <f:param name="locale" value="en"/>
                    </h:commandLink> |
                    <h:commandLink action="#{locale.setLocale}" value="ru">
                        <f:param name="locale" value="ru"/>
                    </h:commandLink>
                </h:form>
            </small>
            <h1><h:outputText value="#{bundle.group_attribute}"/></h1>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputText value="#{bundle.id}:"/>
                    <h:outputText value="#{groupType.attr.id}"/>
                    <h:outputLabel for="name" value="#{bundle.name}:"/>
                    <h:inputText id="name" value="#{groupType.attr.name}"
                                 readonly="#{groupType.readonly}"/>
                    <h:outputLabel for="type" value="#{bundle.type}:"/>
                    <h:selectOneMenu value="#{groupType.attr.type}"
                                     readonly="#{groupType.readonly}"
                                     rendered="#{not empty attrType.attrTypes}"
                                     converter="berlin.AttributeTypeConverter">
                        <f:selectItems value="#{attrType.attrTypeItems}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandButton action="#{groupType.persistAttribute}"
                                 value="#{bundle.save}" rendered="#{not groupType.readonly}">
                    <f:param name="id_param" value="#{groupType.attr.id}"/>
                </h:commandButton>
                <h:commandButton actionListener="#{groupType.deleteAttribute}"
                                 action="#{navigator.goToGroupType}"
                                 rendered="#{not groupType.readonly}" value="#{bundle.delete}">
                    <f:attribute name="id_param" value="#{groupType.attr.id}"/>
                </h:commandButton> <br/>
            </h:form>
            <h:form>
                <h:commandLink action="#{groupType.showAllAttributes}"
                               value="#{bundle.attributes_list}"/>
            </h:form>
        </body>
    </html>
</f:view>
